package com.huaxin.hxcloud.frendcircles;

import android.content.Context;
import android.content.Intent;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.huaxin.common.view.nicegridview.NineGridImageViewAdapter;
import com.huaxin.hxcloud.activity.ImgViewActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author songxf
 * @date 2017/11/16
 * @Desc $desc$
 * Copyright HUAXIN DATA. All rights reserved.
 */
public class NineGridImageViewAdaper extends NineGridImageViewAdapter {
    @Override
    protected void onDisplayImage(Context context, ImageView imageView, Object o) {
        Glide.with(context).load(o).into(imageView);
    }

    @Override
    protected boolean onItemImageLongClick(Context context, ImageView imageView, int index, List list) {
        return super.onItemImageLongClick(context, imageView, index, list);
    }

    @Override
    protected void onItemImageClick(Context context, ImageView imageView, int index, List list) {
        super.onItemImageClick(context, imageView, index, list);
        Intent intent = new Intent(context, ImgViewActivity.class);
        intent.putExtra("position", index);
        intent.putStringArrayListExtra("img", (ArrayList<String>) list);
        context.startActivity(intent);
    }
}
